
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>短消息平台</title>
<link type="text/css" rel="stylesheet" href="css/sms.css" />
<script type="text/javascript" src="scripts/jquery.js"></script>

<script type="text/javascript">
   $(function(){
	   var $error= $("#error");//查找 id="error"的元素
	   var $name = $("#name");
	   var $pwd = $("#pwd");
	   $("#login").click(function(){
		   if($name.val()==""){
			   $error.html("用户名不能为空").removeClass().addClass("error");
			   return false;
		   }
		   if($pwd.val()==""){
			   $error.html("密码不能为空").removeClass().addClass("error");
			   return false;
		   }
		   
		   return true;//返回true就会提交表单
	   });
	   
	 
   })
</script>

<style type="text/css">
.error {
	color: red;
}
</style>

</head>
<body>
	<div id="loginTitle" class="png"></div>
	<div id="loginForm" class="userForm png">
		<form action="user.do?param=login" method="post">
			<dl>
				<div id="error"></div>
				<dt>用户名：</dt>
				<dd>
					<input type="text" name="name" id="name" />
				</dd>
				<dt>密 码：</dt>
				<dd>
					<input type="password" name="pwd" id="pwd" />
				</dd>

			</dl>
			<div class="buttons">
				<input class="btn-login png" type="submit" name="submit" value=" "
					id="login" /> <a href="register.html"><input
					class="btn-reg png" type="button" name="register" value=" " /></a>
			</div>
		</form>
	</div>


</body>
</html>








